<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    html * {
      padding: 0;
      margin: 0;
    }
  </style>
</head>
<body>
  <section id="sec">
    <style>
      #sec {
        background: #f00
      }
      .child {
        height: 100px;
        margin-top: 10px;
        background: yellow;
      }
    </style>
    <article class="child"></article>
  </section>
  <section id="margin">
    <style>
      #margin {
        background: pink;
        overflow: hidden;
      }
      #margin p {
        margin: 5px auto 25px;
        background: red;
      }
    </style>
    <p>1</p>
    <div >
      <p>2</p>
    </div>
    <p>3</p>
  </section>
</body>
</html>